package com.abel.bigwater.wflow.file

import org.junit.Test
import org.junit.runner.RunWith
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit4.SpringRunner

@SpringBootTest
@RunWith(SpringRunner::class)
class PhotoTests {
    @Autowired
    var photoBucket: PhotoBucket? = null

    @Test
    fun testPhoto() {
        val photoName = "101.png"

        val key = photoBucket!!.putPhoto("test", photoName, javaClass.getResourceAsStream("/$photoName"))
        val url = photoBucket!!.visitPhoto(key)
        lgr.info("url: $url")
    }

    companion object {
        private val lgr = LoggerFactory.getLogger(PhotoTests::class.java)
    }
}